Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Frame] hookify #2096

Closed
wants to merge 3 commits into from
Closed

[Frame] hookify #2096

wants to merge 3 commits into from

Conversation

sijad
Copy link
Contributor

@sijad sijad commented Sep 7, 2019

WHY are these changes introduced?

related to #1995

WHAT is this pull request doing?

change Frame to use react hooks

🎩 checklist

@sijad sijad force-pushed the hookify-frame branch 4 times, most recently from f4753d4 to 1750f09 Compare September 11, 2019 18:01
@sijad
Copy link
Contributor Author

sijad commented Sep 11, 2019

I think this is ready to be reviewed, I guess codecov/patch fails because of very big changes.

@danrosenthal
Copy link
Contributor

@AndrewMusgrave and @BPScott, would you have some time to look at this PR?

Also, @sijad I think the codecov failure is legitimate. Check this report here, which shows all uncovered lines with dark red in the left margin:

https://codecov.io/gh/Shopify/polaris-react/compare/b23702151a3d99ae0c1988388a270beef7d94236...99725d8b552e4895f6998a30b5b7a5249608cb2c/diff

@sijad
Copy link
Contributor Author

sijad commented Sep 26, 2019

Should code coverage issue get addressed in this PR?

@danrosenthal
Copy link
Contributor

Should code coverage issue get addressed in this PR?

@sijad definitely. Unless there are extreme circumstances, we want 90% code coverage for a PR to merge. Please let us know if you need any help with how to test these changes, or in reading the code coverage report to know where to test.

@sijad sijad force-pushed the hookify-frame branch 5 times, most recently from bb6a66e to c080861 Compare October 2, 2019 08:26
@sijad
Copy link
Contributor Author

sijad commented Oct 2, 2019

it's ready for review

@AndrewMusgrave
Copy link
Member

AndrewMusgrave commented Oct 3, 2019

I don't have time to review this right now, I'll be able to Tuesday though.

Copy link
Member

@AndrewMusgrave AndrewMusgrave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than the one question about skip to content. Thanks for taking this on 🙇 💯 Since this is such a foundation change we'll want a second pair of eyes cc/ @BPScott

src/utilities/tests/set-root-property.test.ts Show resolved Hide resolved
src/components/Frame/tests/Frame.test.tsx Outdated Show resolved Hide resolved
);

const handleClick = useCallback(() => {
if (skipToContentTarget && skipToContentTarget.current) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this previously only included logic to skip to the content target node. Why does it need logic to skip to the content target?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I'm not sure what it's even for, I'm not good with accessibility stuff, do you have any suggestion?

src/components/Frame/Frame.tsx Show resolved Hide resolved
@sijad sijad force-pushed the hookify-frame branch 2 times, most recently from c8fba25 to f081ff6 Compare October 9, 2019 06:57
Copy link
Member

@BPScott BPScott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for tackling this and for improving test coverage along the way!

I'm stupid busy atm and I'm not in a place where I can easily tophat this (yay bust company laptops) and I'm not that familiar with Frame's code and usage, so I'd also appreciate an extra pair of eyes. @dleroux would you be able to take a look when you get a moment?

I've dropped a few nitpick comments inline. The code looks good, aside from Andrew's queries about skipToTarget, and me wondering if we're handling ribbon resizing on browser resize as I can't see the EventListener for that anymore.

src/components/Frame/Frame.tsx Outdated Show resolved Hide resolved
src/components/Frame/Frame.tsx Show resolved Hide resolved
src/components/Frame/Frame.tsx Outdated Show resolved Hide resolved
src/components/Frame/Frame.tsx Show resolved Hide resolved
</main>
<ToastManager toastMessages={toastMessages} />
{globalRibbonMarkup}
<EventListener event="resize" handler={this.handleResize} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are we handling this now? I can't spot an equivalent definition to catch window resizing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought useMediaQuery does trigger resize for us here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with how useMediaQuery does its thing. @AndrewMusgrave can you confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added resize back, nice catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how often globalRibbonHeight should recalculated, I've added resize back for now, but useMediaQuery might be used as well

@sijad sijad force-pushed the hookify-frame branch 6 times, most recently from 0963af0 to a07a008 Compare October 16, 2019 20:21
@ghost
Copy link

ghost commented Apr 13, 2020

This issue has been inactive for 180 days and labeled with Icebox. It will be closed in 7 days if there is no further activity.

@ghost ghost added the Icebox label Apr 13, 2020
@sijad
Copy link
Contributor Author

sijad commented Apr 14, 2020

This issue has been inactive for 180 days and labeled with Icebox. It will be closed in 7 days if there is no further activity.

🤷‍♂️

@ghost ghost closed this Apr 21, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants